<script type="text/javascript">

    function loadCaptcha(id){
        var src = $('#'+id).attr('src');
        $('#'+id).attr('src',src+"?reload="+ (new Date()).getTime());
    }

    function onSCaptchaImageClick(e){
        loadCaptcha('SCaptchaImage')
    }

    function onYCaptchaImageClick(e){
        loadCaptcha('YCaptchaImage')
    }

    function onFCaptchaImageClick(e){
        loadCaptcha('FCaptchaImage')
    }

    function onTabsOnShow(tab){
        if(tab.length==0){
            return
        }
        switch(tab[0].id){
            case 'file':
             loadCaptcha('FCaptchaImage')
                break;
            case 'youtube':
             loadCaptcha('YCaptchaImage')
                break;
            case 'suggest':
             loadCaptcha('SCaptchaImage')
               break;
        }
    }

    $(document).ready(function() {
        $('ul.tabs').tabs({
            onShow:onTabsOnShow
        });
        $('#FCaptchaImage').on('click', onFCaptchaImageClick);
        $('#YCaptchaImage').on('click', onYCaptchaImageClick);
        $('#SCaptchaImage').on('click', onSCaptchaImageClick);
    });
</script>